package com.flesler.componentas.core.events
{
	import com.flesler.componentas.core.Component;
	
	import flash.events.Event;
	
	public final class EntityEvent extends Event
	{
		public static const INITIALIZED:String = 'eeInitialized';
		public static const COMPONENT_ADDED:String = 'eeComponentAdded';
		public static const COMPONENT_REMOVED:String = 'eeComponentRemoved';
		public static const DESTROYED:String = 'eeDestroyed';
		
		private var _component:Component;
		
		public function EntityEvent(type:String, component:Component=null)
		{
			super(type);
			
			_component = component;
		}
		
		public function get component():Component
		{
			return _component;
		}

		override public function clone():Event
		{
			return new EntityEvent(type, component);
		}
	}
}